package logic

import (
	"context"

	"go-zero-mall/app/admin/cmd/rpc/internal/svc"
	"go-zero-mall/app/admin/cmd/rpc/pd"

	"github.com/zeromicro/go-zero/core/logx"
)

type AdminDeleteLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewAdminDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AdminDeleteLogic {
	return &AdminDeleteLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 管理员-删除
func (l *AdminDeleteLogic) AdminDelete(in *pd.UmsAdminDeleteReq) (*pd.Response, error) {
	err := l.svcCtx.UmsAdminModel.Delete(l.ctx, in.Id)
	if err != nil {
		return nil, err
	}
	return &pd.Response{}, nil
}
